package com.apes.enquiry.supplier.jingshi.common;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @Title: EpcOePjmc
 * @Author fj
 * @Package com.apes.autoparts.product.model
 * @Date 2023/6/8 17:13
 * @description: OE号译码库
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = EpcOePjmc.CONST_TABLE_NAME)
public class EpcOePjmc {

    public static final String CONST_TABLE_NAME = "EPC_OE_PJMC";

    @Id // 添加一个空的id标识，因为jpa在映射实体是需要一个id，这个必须

    @Column(name = "EPC_BBMC")
    @Comment("EPC版本名称")
    private String epcBbmc;

    @Column(name = "PARTNUMBER")
    @Comment("OE号")
    private String partnumber;

    @Column(name = "PJMCID")
    @Comment("配件名称编码")
    private String pjmcid;

    @Column(name = "PJMC")
    @Comment("配件名称")
    private String pjmc;

    @Column(name = "LRR")
    @Comment("录入人")
    private String lrr;

    @Column(name = "TS01")
    @Comment("时间戳")
    private String ts01;

    @Column(name = "BYBJ")
    @Comment("编译标记（不是有效标记）")
    private String bybj;

    @Column(name = "HDBJ")
    @Comment("核对标记")
    private String hdbj;

    @Transient
    private String partsAlias;

    @Override
    public String toString() {
        return "EpcOePjmc{" +
                "epcBbmc='" + epcBbmc + '\'' +
                ", partnumber='" + partnumber + '\'' +
                ", pjmcid='" + pjmcid + '\'' +
                ", pjmc='" + pjmc + '\'' +
                ", lrr='" + lrr + '\'' +
                ", ts01='" + ts01 + '\'' +
                ", bybj='" + bybj + '\'' +
                ", hdbj='" + hdbj + '\'' +
                ", partsAlias='" + partsAlias + '\'' +
                '}';
    }
}
